<?php
require_once 'sesi_login.php';
require_once 'konfigurasi.php';
fungsi('umum');

define('PAGE', 'Pemberitahuan');
define('PAGE_ICO', 'icon-circle-exclamation-mark');
define('PAGE_URL', 'pemberitahuan.php');
define('SUBPAGE', 'Detail Perkara');

/*define('SUBPAGE', 'Detail Perkara');
define('SUBPAGE_ICO', 'icon-file');
define('SUBPAGE_URL', 'perkara.detail.php');
define('PAGE_ID', SUBPAGE_URL.'?kd='.KD_PERKARA);*/


koneksi_buka();
panggil_header();

?>

<!-- Content Area -->
<div id="da-content-area">
<div class="row-fluid">

<div class="span12">
	<div class="da-panel collapsible">
		<div class="da-panel-header">
			<span class="da-panel-title">
				<i class="icon-circle-exclamation-mark"></i> Pemberitahuan
			</span>
		</div>
		<div class="da-panel-content da-table-container">
		<form id="da-form-spdp" class="da-form" method="post" action="functions/crud/perkara.php">
			<table id="da-ex-datatable-numberpaging" class="da-table">
				<thead>
					<tr>
						<th width="120">Tanggal</th>
						<th>Pemberitahuan</th>
						<th width="120">Aksi</th>
					</tr>
				</thead>
				<tbody>
					<?php
						if(LEVEL=="superadmin" || LEVEL=="admin") {
							$q = mysql_query("SELECT * FROM t_pemberitahuan WHERE terbaca='t' and isnull(kd_pegawai) order by waktu");
						} else {
							$q = mysql_query("SELECT * FROM t_pemberitahuan WHERE terbaca='t' AND kd_pegawai='".ID_PEGAWAI."' order by waktu");
						}							
						//$data = mysql_fetch_array(mysql_query("SELECT * FROM t_spdp WHERE kd_perkara='".$kd."'"));						
						while($dt = mysql_fetch_array($q)) {
							$isi = explode('=>',$dt[pemberitahuan]);
					?>
					<tr>
						<td><?php echo $dt['waktu']; ?></td>
						<td><?php echo $isi[0]." No. Perkara : ".$isi[1]; ?></td>
						<td class="da-icon-column">
							<input type="text" name="kd" value="<?php echo KD_PERKARA //$dt['kd_pemberitahuan']; ?>">
							<a href="functions/crud/jaksa.php?nip=<?php echo $dt['nip'] ?>" rel="tooltip" data-placement="top" title="Hapus"><i class="icol-cross"></i></a>
							<button href="#" id="pesan-dialog" class="btn"><i class="icol-printer"></i> Cetak</button>
							
						</td>


		

		
					</tr>
					<?php } ?>
				</tbody>
			</table>
		</form>	
		</div>
	</div>
</div>


<form id="da-form-spdp" class="da-form" method="post" action="functions/crud/perkara.php">
	<div class="btn-row">		
		<button href="#" id="pesan-dialog" class="btn"><i class="icol-printer"></i> Cetak</button>
		<button class="btn"><i class="icol-disk"></i> Simpan</button>
		<input id="mode-input" type="hidden" name="t4" value="simpan" />
		<input type="hidden" name="kd" value="<?php echo $dt['kd_pemberitahuan']; ?>" />
	</div>
</form>


<div id="pesan-dialog-div" style="display:none;">
	<p id="berkas"></p>
</div>

</div>
</div>

<?php
panggil_footer();
koneksi_tutup();
?>
